<?php
namespace app\interfaces\validate;

use think\Validate;

class Member extends Validate
{
    protected $rule = [
        ['username', 'require|unique:member|regex:^1[123456789]{1}\d{9}$'],
        ['code', 'require'],
        ['password', 'require'],
        ['confirm_password', 'require|confirm:password'],

    ];

    protected $message = [
        'username.require' => '请填写手机号',
        'username.unique'  => '手机号已存在',
        'username.regex'   => '请填写正确手机号',
        'code.require'     => '请填写验证码',
        'password.require' => '请选择密码',
        'confirm_password.confirm' => '确认密码不一致',
    ];


    protected $scene = [
        'create' => ['username', 'code', 'password'],
    ];
}